package com.totoro.mapstruct;

import com.totoro.mapstruct.bean.UserDTO;
import com.totoro.mapstruct.mapper.UserMapper;
import com.totoro.mapstruct.bean.UserModel;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * Created by Niki on 2018/8/8 9:09
 */
@Service
public class UserService {
    UserDTO findUser(){
        UserModel user = new UserModel();
        user.setAge(28);
        user.setUserName("小狼狗");
        user.setNickName("旺旺");
        user.setPassword("14887778");
        user.setSalary(1800d);
        user.setCreateDate(new Date());


        return UserMapper.instance.toUserDTO(user);
    }
}
